import javax.ejb.EJB;

import org.x4444.OrderZ;
import org.x4444.entity.OrderP;

public class Main {

	@EJB
	static OrderZ orderZ;

	public static void main(String[] args) {
		if (orderZ != null) {

			System.out.println(orderZ.getClient());
			OrderP orderP = orderZ.getOrder(new Integer(1));
			System.out.println(orderP.getClient());
			int count = 1234;
			try {
				count = Integer.parseInt(args[0]);
			} catch (NumberFormatException e) {

			}
			System.out.println("set: " + count);
			orderP.setCount(count);
			orderZ.saveOrder(orderP);
			
			orderP = orderZ.getOrder(new Integer(1));
			System.out.println("read: " + orderP.getCount());

		} else {
			System.out.println("null");
		}
	}

	/*
	 * (non-Java-doc)
	 * 
	 * @see java.lang.Object#Object()
	 */
	public Main() {
		super();
	}

}